package com.sscw.task.mqtt;

import com.guaike.core.mqtt.processor.MqttGateway;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


@Slf4j
@Component
@AllArgsConstructor
public class MQTTProducer {

    private final MqttGateway mqttGateway;

    public void sendIoMessage(String topic, String message, Integer qosLevel)  {
        log.info("终端发送mqtt消息，topic：{}，message：{}", topic, message);
        mqttGateway.sendToMqtt(topic, qosLevel, message);
    }

}
